﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepCultivation.API.AddliCation.AddressW;
using SheepCultivation.API.AddliCation.PurchaseSales;
using SheepCultivation.Common.Dto;

namespace SheepCultivation.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class PurchaseSalesController : ControllerBase
    {
        public readonly IMediator mediator;

        public PurchaseSalesController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 羊只采购新增
        /// </summary>
        /// <param name="pregnancySeach"></param>
        /// <returns></returns>
        [HttpPost("SheepBuyAdd")]
        public async Task<Result> Handle(SheepBuyCreateCommon SheepBuy)
        {
            return await mediator.Send(SheepBuy);

        }
        /// <summary>
        /// 供应商显示
        /// </summary>
        /// <param name="Vendor"></param>
        /// <returns></returns>
        [HttpPost("VendorList")]
        public async Task<Result> Handle(VendorSeachCommon Vendor)
        {
            return await mediator.Send(Vendor);
        }
        /// <summary>
        /// 摘要显示
        /// </summary>
        /// <param name="Absrtact"></param>
        /// <returns></returns>
        [HttpPost("AbsrtactList")]
        public async Task<Result> Handle(AbsrtactSeachCommon Absrtact)
        {
            return await mediator.Send(Absrtact);
        }
        /// <summary>
        /// 仓库显示
        /// </summary>
        /// <param name="Depot"></param>
        /// <returns></returns>
        [HttpPost("DepotList")]
        public async Task<Result> Handle(DepotSeachCommon Depot)
        {
            return await mediator.Send(Depot);
        }
        /// <summary>
        /// 采购员显示
        /// </summary>
        /// <param name="Buyer"></param>
        /// <returns></returns>
        [HttpPost("BuyerList")]
        public async Task<Result> Handle(BuyerSeachCommon Buyer)
        {
            return await mediator.Send(Buyer);
        }
        /// <summary>
        /// 羊只采购显示
        /// </summary>
        /// <param name="SheepBuy"></param>
        /// <returns></returns>
        [HttpPost("SheepBuyList")]
        public async Task<Result> Handle(SheepBuySeachCommon SheepBuy)
        {
            return await mediator.Send(SheepBuy);

        }
        /// <summary>
        /// 羊只销售添加
        /// </summary>
        /// <param name="SheepSale"></param>
        /// <returns></returns>
        [HttpPost("SheepSaleList")]
        public async Task<Result> Handle(SheepSaleCreateCommon SheepSale)
        {
            return await mediator.Send(SheepSale);

        }
    }
}
